<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html >
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='ttbl' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {background:#fff;}
    </style>
</head>

<body >
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <form:form commandName="withdraw" method="${_method }" class="layui-form" id="form">
            <input type="hidden" name="_method" value="${_method }"/>
            <form:hidden path="id"/>

            <center>
                <div class="layui-form-item">
                    <h1><fmt:message key='ktxje' /><fmt:formatNumber value="${merchant.balance}" type="CURRENCY"/></h1>
                </div>

            </center>


            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='txje' /></label>
                <div class="layui-inline">
                    <fmt:message key='txje' var="txje"/>
                    <form:input path="amount" class="layui-input" placeholder="${txje}" style="width: 200px;"/>
                </div>
                <div class="layui-inline"><fmt:message key='txxkcsxfbl' />：${setting.supplierInvoiceScale}</div>
            </div>

            <div class="layui-input-block">
                <div style="display: none"><input type="button" value="<fmt:message key='bc' />" class="layui-btn" id="submit" lay-filter="submit" lay-submit></div>
            </div>

        </form:form>
    </div>
</div>
<script>
    $(function () {

        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;

            form.on('submit(submit)', function (data) {
                $("#form").ajaxSubmit({
                    success: function (result) {
                        if (result.status) {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            parent.$("#search").click();
                        } else {
                            layui.use('layer', function () {
                                layer.msg(result.message);
                            });
                        }
                    }
                });
            });

        });

    });
</script>
</body>
</fmt:bundle>
</html>